Add boot option to allow console I/O to be placed into ring buffer
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 15 Mar 2007 10:33:32 +0000 (10:33 +0000)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Thu, 15 Mar 2007 10:33:32 +0000 (10:33 +0000)
This option allows console I/O to be placed into the hypervisor
console ring buffer. When enabled, all output to the console
device will be reflected in the ring buffer.  When disabled (the
default), only hypervisor output is available from the ring buffer.

Signed-off-by: Ben Thomas <ben@virtualiron.com>
docs/src/user.tex
xen/drivers/char/console.c

index f71231d44ca839f2279664b689b90873f512cc5c..6706a31acb4b8ded060dc16c0c1e9cdeab014a42 100644 (file)
@@ -3179,6 +3179,11 @@ editing \path{grub.conf}.
   one of 80x25, 80x28, 80x30, 80x34, 80x43, 80x50, 80x60.
   \item[ keep ] Keep the VGA console even after domain 0 boots.
   \end{description}
+\item [ console\_to\_ring ] Place guest console output into the
+  hypervisor console ring buffer. This is disabled by default.
+  When enabled, both hypervisor output and guest console output
+  is available from the ring buffer. This can be useful for logging
+  and/or remote presentation of console data.
 \item [ sync\_console ] Force synchronous console output. This is
   useful if you system fails unexpectedly before it has sent all
   available output to the console. In most cases Xen will
index 927b47112f565cd775d10df6bab65b4d7ec8de2f..ef11d735ba91df35381b7a9d3943c8223198bd9d 100644 (file)
@@ -48,6 +48,10 @@ string_param("conswitch", opt_conswitch);
 static int opt_sync_console;
 boolean_param("sync_console", opt_sync_console);
 
+/* console_to_ring: send guest (incl. dom 0) console data to console ring. */
+static int opt_console_to_ring;
+boolean_param("console_to_ring", opt_console_to_ring);
+
 #define CONRING_SIZE 16384
 #define CONRING_IDX_MASK(i) ((i)&(CONRING_SIZE-1))
 static char conring[CONRING_SIZE];
@@ -329,7 +333,14 @@ static long guest_console_write(XEN_GUEST_HANDLE(char) buffer, int count)
         sercon_puts(kbuf);
 
         for ( kptr = kbuf; *kptr != '\0'; kptr++ )
+        {
             vga_putchar(*kptr);
+            if ( opt_console_to_ring )
+                putchar_console_ring(*kptr);
+        }
+
+        if ( opt_console_to_ring )
+            send_guest_global_virq(dom0, VIRQ_CON_RING);
 
         guest_handle_add_offset(buffer, kcount);
         count -= kcount;